package com.swp.oa.util;

import java.util.Date;

import com.swp.oa.comomn.MySQLDatabaseBackUpOption;

public class MySQLBackUpBySpringQtz {

	protected void execute()  {
		if(MySQLDatabaseBackUpOption.getIsStartBackUp()){
			String fileName = DateUtil.getDateFormat(new Date()) + ".sql";
			MySQLBackUpUtil.exportDatabaseTool(MySQLDatabaseBackUpOption.getBinPath(), 
					MySQLDatabaseBackUpOption.getHostIP(), 
					MySQLDatabaseBackUpOption.getUserName(), 
					MySQLDatabaseBackUpOption.getPassWord(), 
					MySQLDatabaseBackUpOption.getSavePath(), 
					fileName, 
					MySQLDatabaseBackUpOption.getDatabaseName());			
		}else{
			System.out.println("想要备份SQL请设置启动MySQL备份。");
		}
	}

}
